package swd.maintain.system.sync_db_table;

import java.util.*;

public class View {
    public View() {
        setMultiLang();
        setDBProperties();
    }

    private String gstrOnloadScript;
    public String getOnloadScript() {
        return this.gstrOnloadScript;
    }

    public void setOnloadScript(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrOnloadScript = pstrParameter;
    }

    private String gstrPrgTitle;
    public String getPrgTitle() {
        return this.gstrPrgTitle;
    }

    public void setPrgTitle(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrPrgTitle = pstrParameter;
    }

    private String gstrPrgAction;
    public String getPrgAction() {
        return this.gstrPrgAction;
    }

    public void setPrgAction(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrPrgAction = pstrParameter;
    }

    private String gstrPrgStatus;
    public String getPrgStatus() {
        return this.gstrPrgStatus;
    }

    public void setPrgStatus(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrPrgStatus = pstrParameter;
    }

    private String gstrDBAlias;
    public String getDBAlias() {
        return this.gstrDBAlias;
    }

    public void setDBAlias(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrDBAlias = pstrParameter;
    }

    private boolean gblnDBDebug;
    public boolean getDBDebug() {
        return this.gblnDBDebug;
    }

    public void setDBDebug(boolean pblnParameter) {
        this.gblnDBDebug = pblnParameter;
    }

    private String gstrSourceCharset;
    public String getSourceCharset() {
        return this.gstrSourceCharset;
    }

    public void setSourceCharset(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrSourceCharset = pstrParameter;
    }

    private String gstrTargetCharset;
    public String getTargetCharset() {
        return this.gstrTargetCharset;
    }

    public void setTargetCharset(String pstrParameter) {
        if (pstrParameter != null && pstrParameter.equals("null")) {
            pstrParameter = null;
        }
        this.gstrTargetCharset = pstrParameter;
    }

    private String gstrdataKind;
    public String getDataKind() {
        return this.gstrdataKind;
    }

    public void setDataKind(String pstrParameter) {
        this.gstrdataKind = pstrParameter;
    }

    private void setMultiLang() {
        ResourceBundle rbdTitleResource = ResourceBundle.getBundle(
                "swd\\maintain\\system\\sync_db_table\\Multi-lang", Locale.getDefault());

        try {
            this.setPrgTitle(rbdTitleResource.getString("prgTitle"));
            this.setSrc_db_aliasTitle(rbdTitleResource.getString("src_db_aliasTitle"));
            this.setTrg_db_aliasTitle(rbdTitleResource.getString("trg_db_aliasTitle"));
            this.setCreateTableTitle(rbdTitleResource.getString("isCreateTableTitle"));
            this.setTransfer_table_listTitle(rbdTitleResource.getString("transfer_table_listTitle"));
            this.setTransfer_table_resultTitle(rbdTitleResource.getString("transfer_table_resultTitle"));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private void setDBProperties() {
        ResourceBundle rbdTitleResource = ResourceBundle.getBundle("WEB_Config",
                Locale.getDefault());

        try {
            setDBAlias(rbdTitleResource.getString("DB_ALIAS"));
            setDBDebug(Boolean.valueOf(rbdTitleResource.getString("DEBUG")).
                       booleanValue());
            setSourceCharset(rbdTitleResource.getString("SOURCE_CHARSET"));
            setTargetCharset(rbdTitleResource.getString("TARGET_CHARSET"));
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            rbdTitleResource = null;
        }
    }

    public String getMessage(String pstrKey) {
        return ResourceBundle.getBundle("swd\\maintain\\system\\backup_project_table\\Multi-lang",
                                        Locale.getDefault()).getString(pstrKey);
    }

    public void setDb_alias_list(String db_alias_list) {
        this.db_alias_list = db_alias_list;
    }

    public void setTrg_db_aliasTitle(String trg_db_aliasTitle) {
        this.trg_db_aliasTitle = trg_db_aliasTitle;
    }

    public void setTransfer_table_resultTitle(String transfer_table_resultTitle) {
        this.transfer_table_resultTitle = transfer_table_resultTitle;
    }

    public void setTransfer_table_listTitle(String transfer_table_listTitle) {
        this.transfer_table_listTitle = transfer_table_listTitle;
    }

    public void setSrc_db_aliasTitle(String src_db_aliasTitle) {
        this.src_db_aliasTitle = src_db_aliasTitle;
    }

    public void setTrg_db_alias(String trg_db_alias) {
        this.trg_db_alias = trg_db_alias;
    }

    public void setSrc_db_alias(String src_db_alias) {
        this.src_db_alias = src_db_alias;
    }

    public void setTransfer_table_list(String[] transfer_table_list) {
        this.transfer_table_list = transfer_table_list;
    }

    public void setCreateTableTitle(String createTableTitle) {
        this.createTableTitle = createTableTitle;
    }

    public void setCreateTable(boolean createTable) {
        this.createTable = createTable;
    }

    public String getDb_alias_list() {
        return db_alias_list;
    }

    public String getTrg_db_aliasTitle() {
        return trg_db_aliasTitle;
    }

    public String getTransfer_table_resultTitle() {
        return transfer_table_resultTitle;
    }

    public String getTransfer_table_listTitle() {
        return transfer_table_listTitle;
    }

    public String getSrc_db_aliasTitle() {
        return src_db_aliasTitle;
    }

    public String getTrg_db_alias() {
        return trg_db_alias;
    }

    public String getSrc_db_alias() {
        return src_db_alias;
    }

    public String[] getTransfer_table_list() {
        return transfer_table_list;
    }

    public String getCreateTableTitle() {
        return createTableTitle;
    }

    public boolean isCreateTable() {
        return createTable;
    }

    private String db_alias_list = null;

    private String src_db_aliasTitle =null;
    private String trg_db_aliasTitle =null;

    private String src_db_alias = null;
    private String trg_db_alias = null;

    private boolean createTable = false;
    private String createTableTitle = null;

    private String transfer_table_listTitle=null;
    private String transfer_table_resultTitle=null;

    private String[] transfer_table_list=null;
}
